package cv

import (
	"dustbe/util"
	"fmt"
	"os"
	"runtime"
)

var (
	python       string
	cachePath    string = "./data/cache"
	srLaunchFile string
	srModelPath  string
	srStageNum   int = 16
)

func init() {
	switch runtime.GOOS {
	case "windows":
		{
			python = "python"
			srLaunchFile = "E:\\Project\\SR\\Real-ESRGAN-0.2.2.4\\quick_start\\real-esrgan-show.py"
			srModelPath = "E:\\Project\\SR\\Real-ESRGAN-0.2.2.4\\quick_start\\model.pth"
		}
	case "linux":
		{
			python = "python3"
			srLaunchFile = "/usr/local/python/CV/SR/real-esrgan-show.py"
			srModelPath = "/usr/local/python/CV/SR/model.pth"
		}
	}

	launchfileExist, _ := util.CheckFilePath(srLaunchFile)
	modelFileExist, _ := util.CheckFilePath(srModelPath)

	if !util.Debug && !launchfileExist {
		fmt.Printf("launch file %s doesn't exist!\n", srLaunchFile)
		os.Exit(-1)
	}
	if !util.Debug && !modelFileExist {
		fmt.Printf("model file %s doesn't exist!\n", srModelPath)
		os.Exit(-1)
	}
}
